
import 'package:flutter/material.dart';

enum CustomCellStyle {
  normal,
  normalIcon,
}

class EMPCustomCell extends StatefulWidget {

  final String title;
  final String subtitle;
  final VoidCallback onTap;
  final CustomCellStyle cellStyle;

  EMPCustomCell({required this.title, required this.subtitle, required this.onTap, required this.cellStyle});

  @override
  _EMPCustomCellState createState() => _EMPCustomCellState();
}

class _EMPCustomCellState extends State<EMPCustomCell> {

  @override
  Widget build(BuildContext context) {

    if(widget.cellStyle == CustomCellStyle.normal){
      return normalCell();
    }
    else if(widget.cellStyle == CustomCellStyle.normalIcon){
      return normalCell();
    }

    return Container();
  }

  Widget normalCell() {
    return GestureDetector(
      onTap: widget.onTap,
      child: Container(
        padding: EdgeInsets.all(16.0),
        decoration: BoxDecoration(
          border: Border(
            bottom: BorderSide(color: Colors.grey.shade300),
          ),
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              widget.title,
              style: TextStyle(
                fontSize: 18,
                fontWeight: FontWeight.bold,
              ),
            ),
            SizedBox(height: 8.0),
            Text(
              widget.subtitle,
              style: TextStyle(
                fontSize: 16,
                color: Colors.grey,
              ),
            ),
          ],
        ),
      ),
    );
  }

}


